import { graphql } from 'gatsby'
import React from 'react'

export default function Article({data}) {
  return (
    <div>
      <p>{data.markdownRemark.frontmatter.title}</p>
      <p>{data.markdownRemark.frontmatter.date}</p>
      <div dangerouslySetInnerHTML={{__html:data.markdownRemark.html}}></div>
    </div>
  )
}

export const query = graphql`
query ($slug: String) {
  markdownRemark(fields: {slug: {eq: $slug}}) {
    html
    frontmatter {
      date
      title
    }
    id
  }
}
`
